package com.suxin.security;

import org.springframework.security.web.util.matcher.RequestMatcher;

import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author Tang
 * @classname DefaultSecurityFilterChain
 * @description [  ]
 * @date 2022/8/16 17:05
 */
public class DefaultSecurityFilterChain implements SecurityFilterChain {

    private RequestMatcher requestMatcher;

    private List<Filter> filters;

    public DefaultSecurityFilterChain(RequestMatcher requestMatcher, List<Filter> filters) {
        this.requestMatcher = requestMatcher;
        this.filters = filters;
    }

    @Override
    public boolean match(HttpServletRequest request) {
        return requestMatcher.matches(request);
    }

    @Override
    public List<Filter> getFilters() {
        return filters;
    }
}
